<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
namespace Admin\Model;
use Think\Model;
class Contentmodel extends Model{
    public function content(){
        return $this->select();
    }
    public function read($id){
        $map=array();
        $map['id']=$id;
        return $this->where($map)->find();
    }
    public function updatecontent($id,$version,$category,$title,$body,$img){
        $map=array();
        $map['id']=$id;
        $map['version']=$version;
        $map['category']=$category;
        $map['title']=$title;
        $map['body']=$body;
        $map['img']=$img;
        return $this->where('id='.$map['id'])->save($map);
    }
   public function deletecontent($id){
       $map=array();
       $map['id']=$id;
       return $this->where('id='.$map['id'])->delete();               
   }
}
